package cate.common.table.text;

import cate.common.table.ESheet;
import cate.common.table.d.GDNotice;
import cate.common.util.random.RWList;


/** 系统公告 */
public class TextLampSheet extends ESheet<TextLampRow> {
    private final RWList<TextLampRow> lampList = new RWList<>();

    @Override
    public String getSheetName() {
        return "系统公告";
    }

    @Override
    public void onLoaded(){
        super.onLoaded();
        lampList.clear();
        this.getList().forEach(r -> {
            if(r.type == GDNotice.NoticeType.RANDOM.getType()){
                lampList.add(r);
            }});
        lampList.setup();
    }

    public TextLampRow randomSystemNotice(){
        return lampList.get();
    }
}
